<template>
	<view>
		<view class="uni-header-logo">
			<image class="uni-header-image" src="/static/componentIndex.png"></image>
		</view>
		<uni-section title="个人中心" type="line"></uni-section>
		<view class="uni-panel">
			<view  class="uni-navigate-item" @click="goDetailPage('my','info')">
				<text class="uni-navigate-text">个人信息</text>
				<text class="uni-navigate-icon uni-icon">&#xe470;</text>
			</view>
			<view  class="uni-navigate-item" v-if="role != 'parent'" @click="goDetailPage('my','password')">
				<text class="uni-navigate-text">修改密码</text>
				<text class="uni-navigate-icon uni-icon">&#xe470;</text>
			</view>
			<view  class="uni-navigate-item" v-if="role != 'teacher'" @click="goDetailPage('oa','msg')">
				<text class="uni-navigate-text">站内消息</text>
				<text class="uni-navigate-icon uni-icon">&#xe470;</text>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				userId: {},
				role: 'none'
			}
		},
		onLoad() {
			 if(!this.$store.state.token){
				uni.navigateTo({
					url: '/pages/login/login'
				});
			}
			const user = this.$store.getters.user;
			this.userId = user.userId;
			this.role = this.$store.getters.role;
		}
	}
</script>

<style>
	.uni-form-item .title {
		padding: 20rpx 0;
	}
</style>
